package com.atguigu.javase.thread;


public class AccountTest {

    public static void main(String[] args) {
        Account account = new Account("张三",5000);

        Runnable runner = new Deposit(account);

        Thread thread1 = new Thread(runner);
        thread1.setName("存钱线程1");
        thread1.start();
        Thread thread2 = new Thread(runner);
        thread2.setName("存钱线程2");
        thread2.start();

        Runnable runner2 = new Withdraw(account);
        Thread thread3 = new Thread(runner2);
        thread3.setName("取钱线程1");
        thread3.start();
        Thread thread4 = new Thread(runner2);
    }
}
